package com.cskaoyan.controller.wx;

import com.cskaoyan.bean.BaseRespVo;
import com.cskaoyan.bean.Brand;
import com.cskaoyan.bean.ListData;
import com.cskaoyan.bean.vo.BrandDetailVO;
import com.cskaoyan.bean.vo.BrandListData;
import com.cskaoyan.service.wx.WxBrandService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author heyyon
 */
@RestController
@RequestMapping("wx/brand")
public class WxBrandController {
    @Autowired
    WxBrandService wxBrandService;
    @RequestMapping("list")
    public BaseRespVo list(Integer page, Integer size) {
        BrandListData<Brand> brands= wxBrandService.list(page, size);
        return BaseRespVo.ok(brands);
    }
    @RequestMapping("detail")
    public BaseRespVo list(Integer id) {
        BrandDetailVO brandDetailVO = wxBrandService.detail(id);
        return BaseRespVo.ok(brandDetailVO);
    }
}
